<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/pay.js"></script>
		<script type="text/javascript">
			// let r = pay();
			// if (r == "success") {
			// 	console.log("成功");
			// } else {
			// 	console.log("失败");
			// }

			// prompt("阻塞");

			// console.log("其他事情")



			const p = new Promise(function(resolve, reject) {
				let r = pay();
				if (r == "success") {
					resolve();
				} else {
					reject()
				}
			});

			p.then(function() {
				console.log("支付成功");
			}, function() {
				console.log("支付失败");
			})

			console.log("其他事情")
		</script>
	</head>
	<body>
	</body>
</html>
